from django.contrib import admin
from .models import *

# Register your models here.


class HeroInfoInLine(admin.TabularInline):
    model = HeroInfo
    extra = 3


class BookInfoAdmin(admin.ModelAdmin):
    # 需要显示该字段
    list_display = ['id', 'btitle', 'bpub_date']
    # 搜索字段，会在顶部显示
    search_fields = ['btitle']
    # 一页放多少条
    list_per_page = 10
    inlines = [HeroInfoInLine]


admin.site.register(BookInfo, BookInfoAdmin)
admin.site.register(HeroInfo)
